package com.woniuxy.direct;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: 曾令忠
 * @Description: 路由模式的生产者
 * @Date: 2020/7/4 0004-下午 5:01
 */
@Component
public class DirectProductor {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(){
        rabbitTemplate.convertAndSend("directExchange","news","美国确诊病例创新高");
        rabbitTemplate.convertAndSend("directExchange","tech","天问一号即将发射");
    }

}
